package com.example.core.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.core.mapping.Mapping;
import com.example.core.po.BasePo;
import com.example.core.vo.BaseVo;
import org.springframework.context.ApplicationContext;

public interface BaseService<T extends BasePo, V extends BaseVo> extends IService<T> {

    public String add(T po) throws Exception;

    public String add(V vo) throws Exception;

    public String update(V vo) throws Exception;

    public V view(String id) throws Exception;

    public void delete(String id) throws Exception;

    public T toPo(V vo) throws Exception;

    public V toVo(T po) throws Exception;

    public Class<? extends Mapping> getMappingClass();

    public Mapping getMapping();

    public String[] getNullPropertyNames(Object source);

    public void copyToPoEnums(T po, V vo) throws Exception;

    public void copyToVoEnums(T po, V vo) throws Exception;

    public ApplicationContext getApplicationContext();

    public Object getBean(String name);

    public Object getBean(Class clazz);

    public Class<? extends BasePo> getPoClass();

    public Class<? extends BaseVo> getVoClass();

    public IPage<T> findPage(BaseVo vo, QueryWrapper<T> queryWrapper);
}
